<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateClockInDayRulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('clock_in_day_rules', function (Blueprint $table) {
            $table->increments('id')->comment('签到积分规则');
            $table->integer('sort')->nullable()->comment('排序')->default(0);
            $table->integer('integral')->nullable()->comment('积分数量')->default(0);
            $table->string('title', 255)->nullable()->comment('标题');
            $table->tinyInteger('type')->nullable()->comment('1每日规则，2累计规则')->default(1);
            $table->integer('day')->nullable()->comment('每日规则为1, 累计规则为累计天数')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('clock_in_day_rules');
    }
}
